package com.explorati.design_pattern.behavior.interpreter;

/**
 * 终结符表达式(Terminal Expression)角色：该角色实现了抽象表达式角色所要求的接口，文法中的每一个终结符都有一个具体终结表达式与之对应
 * 
 * @author explorati
 *
 */
public class NumberInterpreter implements Interpreter {

	private int number;

	public NumberInterpreter(int number) {
		this.number = number;
	}

	public NumberInterpreter(String number) {
		this.number = Integer.parseInt(number);
	}

	@Override
	public int interpret() {
		return this.number;
	}

}
